home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Collections: Franz PD
/
Franz PD Disk #279 (1993)(Rhein-Sieg-Soft).zip
/
Franz PD Disk #279 (1993)(Rhein-Sieg-Soft).adf
/
ak_gen0-lib_V38.20.LHA
/
ak_gen0-library
/
Programmers.LHA
/
Programmers
/
Headers
/
ak_gen0.h
< prev
Wrap
C/C++ Source or Header
|
1993-10-17
|
18KB
|
465 lines
/* ************************************************************************ */
/* AK_GEN0_H (Headerfile for use with the "ak_gen0.library") */
/* ************************************************************************ */
/* (c) 1989-93 by Andreas Ralph Kleinert. All rights reserved. */
/* COMMERCIAL USE IS NOT ALLOWED WITHOUT SPECIAL PERMISSION BY THE AUTHOR ! */
/* ************************************************************************ */
/* Version : V38.20 */
/* Last updated : 17.10.1993 */
/* Compiler : SAS/C V6.3 */
/* Compiler-Options : (smakefile) */
/* ************************************************************************ */
/* Address : Andreas R. Kleinert */
/* Grube Hohe Grethe 23 */
/* D-57074 Siegen */
/* Germany */
/* ************************************************************************ */
/* NOTE : Always make use of #pragmas, if possible and NEVER use stubs
for "ak_gen0.library", when using ANY kind of #pragmas under
SAS/C V6.00+
*/
#ifndef AK_GEN0_AK_GEN0_H
#define AK_GEN0_AK_GEN0_H
/* *************************************************** */
/* * * */
/* * Version and Revision Defines * */
/* * * */
/* *************************************************** */
#define AK_GEN0_VERSION (38)
#define AK_GEN0_REVISION (20)
#define AK_GEN0_MINIMUM (35)
/* You should only use versions greater than V34, because of various reasons.
Your actual "minimum" may be higher, if you make use of new functions.
*/
/* *************************************************** */
/* * * */
/* * #includes * */
/* * * */
/* *************************************************** */
#ifndef INTUITION_INTUITION_H
#include <intuition/intuitionbase.h>
#endif /* INTUITION_INTUITION_H */
#ifndef EXEC_MEMORY_H
#include <exec/memory.h>
#endif /* EXEC_MEMORY_H */
#ifndef EXEC_LISTS_H
#include <exec/lists.h>
#endif /* EXEC_LISTS_H */
#ifndef GRAPHICS_GFXBASE_H
#include <graphics/gfxbase.h>
#endif /* GRAPHICS_GFXBASE_H */
#ifndef LIBRARIES_DOS_H
#include <libraries/dos.h>
#endif /* LIBRARIES_DOS_H */
#ifndef _STDIO_H
#include <stdio.h>
#endif /* _STDIO_H */
/* *************************************************** */
/* * * */
/* * Specific Defines * */
/* * * */
/* *************************************************** */
#define N (NULL)
#define NEWWINDOW (sizeof(struct NewWindow))
#define WINDOW (sizeof(struct Window))
#define BORDER (sizeof(struct Border))
#define MENU (sizeof(struct Menu))
#define GADGET (sizeof(struct Gadget))
#define ITEXT (sizeof(struct IntuiText))
#define ITEM (sizeof(struct MenuItem))
#define SUBITEM ITEM
#define STRINGINFO (sizeof(struct StringInfo))
#define REQUESTER (sizeof(struct Requester))
#define PROPINFO (sizeof(struct PropInfo))
#define ALERT (sizeof(struct AlertData))
#define NEWSCREEN (sizeof(struct NewScreen))
/* *************************************************** */
/* * * */
/* * Specific Constants * */
/* * * */
/* *************************************************** */
#define AK_FILEREQ_STRING_LEN (256) /* The Filerequester creates a string */
/* of this length. */
/* This will not change (because of the */
/* nice BCPL-like DOS) and can be used */
/* as a parameter to "FreeMem()". */
/* *************************************************** */
/* * * */
/* * Library Base Definitions * */
/* * * */
/* *************************************************** */
/* Library-Bases are to be declared as externals. */
/* Define AKG_NOBASES if you do not want to use these. */
#ifndef AKG_NOBASES
struct IntuitionBase *IntuitionBase = N;
struct GfxBase *GfxBase = N;
struct AKBase *AKBase = N;
#endif /* AKG_NOBASES */
/* *************************************************** */
/* * * */
/* * MACROs * */
/* * * */
/* *************************************************** */
#define xMEN(x) MENUNUM(x->Code) /* NOTE : Use these, if possible */
#define xITN(x) ITEMNUM(x->Code) /* or use the originals !!! */
#define xSTN(x) SUBNUM(x->Code)
/* *************************************************** */
/* * * */
/* * Structure Definitions * */
/* * * */
/* *************************************************** */
/* Note : Currently there are two different kinds of Requesters
implemented : The FileRequester and the ModeRequester.
Do no longer use the (obsolete) AK_Requester structure, but
the new specific ones.
The new structures are be backward-compatible to the old ones.
*/
struct AK_FileRequester
{
APTR akr_APTR; /* RESERVED. ONLY FOR PRIVATE USE. */
ULONG akr_Type; /* Requestertype. See flags below. DO NOT CHANGE !!! */
ULONG akr_Flags; /* PRIVATE. (up to now) */
ULONG akr_Reserved1; /* PRIVATE. (up to now) */
/* ENTRIES TO BE MODIFIED BY THE USER (BEGIN) */
APTR akr_Window; /* Pointer to User-Window or NULL (CURRENT_WINDOW). */
LONG akr_LeftEdge; /* Distance to the left border of your Screen. */
LONG akr_TopEdge; /* Distance to the top border of your Screen. */
BYTE *akr_Title; /* Pointer to title text for Window. May be NULL. */
BYTE *akr_OKText; /* Pointer to text for OK-Gadget. May be NULL. */
BYTE *akr_CancelText; /* Pointer to text for Cancel-Gadget. May be NULL. */
LONG akr_FGColor; /* Foreground color (window). Default is -1. */
LONG akr_BGColor; /* Background color (window). Default is -1. */
/* With ak_gen0-Requester only used for OK/Cancel */
/* gadgets. */
ULONG akr_DefaultDir; /* Default-DirectoryName */
ULONG akr_DefaultFile;/* Default-FileName */
/* ENTRIES TO BE MODIFIED BY THE USER (END) */
ULONG akr_ULONG[1]; /* Always set to NULL yet. */
APTR akr_Tags; /* RESERVED for future expansions. Always NULL. */
/* ======================================================================= */
/* SIZE MAY GROW IN FUTURE VERSIONS. ONLY ALLOC WITH AK_AllocRequester() ! */
/* FREE WITH AK_FreeRequester(). */
/* ======================================================================= */
};
struct AK_ScreenModeRequester
{
APTR akr_APTR; /* RESERVED. ONLY FOR PRIVATE USE. */
ULONG akr_Type; /* Requestertype. See flags below. DO NOT CHANGE !!! */
ULONG akr_Flags; /* PRIVATE. (up to now) */
ULONG akr_Reserved1; /* PRIVATE. (up to now) */
/* ENTRIES TO BE MODIFIED BY THE USER (BEGIN) */
APTR akr_Window; /* Pointer to User-Window or NULL (CURRENT_WINDOW). */
LONG akr_LeftEdge; /* Distance to the left border of your Screen. */
LONG akr_TopEdge; /* Distance to the top border of your Screen. */
BYTE *akr_Title; /* Pointer to title text for Window. May be NULL. */
BYTE *akr_OKText; /* Pointer to text for OK-Gadget. May be NULL. */
BYTE *akr_CancelText; /* Pointer to text for Cancel-Gadget. May be NULL. */
LONG akr_FGColor; /* Foreground color (window). Default is -1. */
LONG akr_BGColor; /* Background color (window). Default is -1. */
/* With ak_gen0-Requester only used for OK/Cancel */
/* gadgets. */
/* ENTRIES TO BE MODIFIED BY THE USER (END) */
ULONG akr_ULONG[3]; /* Always set to NULL yet. */
APTR akr_Tags; /* RESERVED for future expansions. Always NULL. */
/* ======================================================================= */
/* SIZE MAY GROW IN FUTURE VERSIONS. ONLY ALLOC WITH AK_AllocRequester() ! */
/* FREE WITH AK_FreeRequester(). */
/* ======================================================================= */
};
/*
HOW TO USE THE REQUESTER-STRUCTURES :
Alloc the structures with :
---------------------------
AK_AllocRequester()
Use the structures with :
---------------------------
- AK_ExtFileRequest() (if AK_REQTYPE_FILE)
- AK_ModeRequest() (if AK_REQTYPE_MODE)
Free the structures with :
---------------------------
AK_FreeRequester()
*/
/* Flags for akr_Type AND AK_AllocRequester() */
#define AK_REQTYPE_NONE (0x00000000)
#define AK_REQTYPE_INVALID (0xFFFFFFFF)
#define AK_REQTYPE_FILE (0x00000002)
#define AK_REQTYPE_MODE (0x00000004)
#define AK_REQTYPE_RESERVED1 (0x00000001) /* unused, fails yet */
#define AK_REQTYPE_RESERVED2 (0x00000003) /* unused, fails yet */
/* Flags for akr_Flags : */
#define AK_REQFLAG_RESERVED (~(NULL)) /* PRIVATE. (up to now) */
/* *********************************************************************** */
/* Below you find the definitions for structures which are used by
the V37-function AK_GetDirList() and delocated by AK_FreeDirList().
These functions are used by the internal FileRequester, but may also
be used by applications.
*/
struct AK_DirList
{
struct List dl_EntryList; /* List of Entries. Type : struct AK_DirEntry */
LONG dl_NumEntries; /* Number of List-Entries */
/* ======================================================================= */
/* SIZE MAY GROW IN FUTURE VERSIONS. DO NOT ALLOCATE BY HAND ! */
/* ======================================================================= */
};
#define AK_DE_DIR (1<<0) /* Flags set in the de_Flags field. */
#define AK_DE_FILE (1<<1)
#define AK_DE_VOLUME (1<<2)
#define AK_DE_ASSIGN (1<<3)
struct AK_DirEntry
{
struct Node de_Node; /* Node for chaining */
BYTE *de_Name; /* Entry's Name (== de_Node.ln_Name) */
LONG de_NameBufLen; /* Length of NameBuffer */
ULONG de_Flags; /* Flags : File, Dir, ... */
/* ======================================================================= */
/* SIZE MAY GROW IN FUTURE VERSIONS. DO NOT ALLOCATE BY HAND ! */
/* ======================================================================= */
};
/* *********************************************************************** */
/* Below you find the definitions for structures which are used by
the V37-function AK_GetModeList() and delocated by AK_FreeModeList().
These functions are used by the internal ModeRequester, but may also
be used by applications.
*/
struct AK_ModeList
{
struct List ml_EntryList; /* List of Entries. Type : struct AK_ModeEntry */
LONG ml_NumEntries; /* Number of List-Entries */
/* ======================================================================= */
/* SIZE MAY GROW IN FUTURE VERSIONS. DO NOT ALLOCATE BY HAND ! */
/* ======================================================================= */
};
/* The AK_ModeEntry structure, retured by AK_GetModeList() */
struct AK_ModeEntry
{
struct Node ModeNode;
ULONG Length; /* THIS IS THE LENGTH OF THIS STRUCTURE. */
BYTE ModeName [80]; /* V33+ : constructed Name --- V37+ : ModeName */
LONG StandardWidth; /* standard Screen-Depth */
LONG StandardHeight; /* standard Screen-Depth */
LONG MaxWidth; /* maximum Screen-Width (OverScan) */
LONG MaxHeight; /* maximum Screen-Height (OverScan) */
LONG MaxDepth; /* maximum Screen-Depth */
ULONG ModeID; /* V33+ : Convert to UWORD --- V37+ : useable */
APTR ModeHandle; /* V33+ : always NULL --- V37+ : useable */
/* SIZE MAY GROW IN THE FUTURE !!! */
};
/* *********************************************************************** */
/* Below you find the definitions for structures which are used by
the V38-functions for memory allocation, delocation and remembering.
These functions are used by the internal Requesters, but may also
be used by applications.
*/
struct AK_MemList
{
struct List ml_EntryList; /* List of Entries. Type : struct AK_MemEntry */
LONG ml_NumEntries; /* Number of List-Entries */
/* ======================================================================= */
/* SIZE MAY GROW IN FUTURE VERSIONS. DO NOT ALLOCATE BY HAND ! */
/* ======================================================================= */
};
/* The AK_MemEntry structure, retured by AK_GetMemList() */
struct AK_MemEntry
{
struct Node MemNode;
ULONG Length; /* THIS IS THE LENGTH OF THIS STRUCTURE. */
ULONG MemSize;
APTR MemPointer;
/* SIZE MAY GROW IN THE FUTURE !!! */
};
/* *************************************************** */
/* * * */
/* * Library Function Declarations * */
/* * * */
/* *************************************************** */
#ifndef AKG_NOPROTOS
extern struct Screen * __stdargs AK_Screen(long l, long t, long w, long h, long d,
long dp, long bp, long vm, long ty,
struct TextAttr *f, char *title,
struct BitMap *cbm);
extern struct Window * __stdargs AK_Window(long l, long t, long w, long h, long d,
long b, long idcmp, long flags,
struct Gadget *fg, struct Image *cm,
char *title, struct Screen *screen,
struct BitMap *bm, long minw, long minh,
long maxw, long maxh, long type);
extern struct Menu * __stdargs AK_Menu(struct Menu *next, long l, long w, long flags,
char *name, struct MenuItem *item);
extern struct MenuItem * __stdargs AK_MenuItem(struct MenuItem *next, long t, long w,
long flags, long me, APTR itfi,
APTR sefi, long scut,
struct MenuItem *subi);
extern struct MenuItem * __stdargs AK_SubItem(struct MenuItem *next, long l, long t,
long w, long flags, long me, APTR itfi,
APTR sefi, long scut,
struct MenuItem *subi);
extern struct Gadget * __stdargs AK_Gadget(struct Gadget *next, long l, long t, long w,
long h, long flags, long act, long type,
APTR gadr, APTR selr, struct IntuiText *text,
APTR sp, long id);
extern struct StringInfo * __stdargs AK_StringInfo(long groesse, long maximum,
struct KeyMap *km);
extern struct Border * __stdargs AK_Border(long l, long t, long f, long b, long d,
long c, SHORT *xy, struct Border *next);
extern struct IntuiText * __stdargs AK_IText(long f, long b, long d, long l, long t,
struct TextAttr *font, char *text,
struct IntuiText *next);
extern void __stdargs AK_GfxPrint(struct Window *w, char *text, long x, long y);
extern void __stdargs AK_IntuiPrint(struct Window *w, char *text, long x, long y);
extern void __stdargs AK_RefreshDisp(struct Screen *sc, struct Window *w);
extern long __stdargs AK_AutoRequester(struct Window *w, char *obertext, char *jatext,
char *neintext);
extern long __stdargs AK_Alert(char *text, long height);
extern char * __stdargs AK_FileRequest(long xpos, long ypos, struct Screen *fscreen,
struct Window *fwindow, long ftype);
extern long /* OBSOLETE */__stdargs AK_ReadDir(char *pathname, char **direntry, long *dirtype);
extern void __stdargs AK_WaitKey(long rawcode);
extern void __stdargs AK_WaitLeft(void);
extern long __stdargs AK_GetNum(long min, long max);
/* NEW in V36 */
extern APTR __stdargs AK_AllocRequester(long type);
extern void __stdargs AK_FreeRequester(struct AK_Requester *ak_req);
extern char * __stdargs AK_ExtFileRequest(struct AK_Requester *ak_req);
/* NEW in V37 */
extern struct AK_DirList * __stdargs AK_GetDirList(char *dirname, APTR reserved);
extern void __stdargs AK_FreeDirList(struct AK_DirList *ak_list);
extern struct AK_ModeList * __stdargs AK_GetModeList(void);
extern void __stdargs AK_FreeModeList(struct AK_ModeList *modelist);
extern struct AK_ModeEntry * __stdargs AK_ModeRequest(struct AK_Requester *ak_req);
/* NEW in V38 */
extern struct AK_MemList * __stdargs AK_GetMemList(void);
extern void __stdargs AK_FreeMemList(struct AK_MemList *MemList);
extern long __stdargs AK_AddMemEntry(struct AK_MemList *mlist, APTR pointer, long size);
extern APTR __stdargs AK_AllocMemEntry(struct AK_MemList *mlist, ULONG size, ULONG type);
#endif /* AKG_NOPROTOS */
/* *************************************************** */
/* * * */
/* * OBSOLETE #includes * */
/* * * */
/* *************************************************** */
/* Now include the OBSOLETE things of former versions.
Define AKG_NOOBSOLETE if you don't make use of them.
(Actually you SHOULD NOT make use of them.)
*/
#ifndef AKG_NOOBSOLETE
#include <ak_gen0_obsolete.h>
#endif /* AKG_NOOBSOLETE */
#endif /* AK_GEN0_AK_GEN0_H */